home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4372 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.1 KB  |  47 lines

  1. Newsgroups: comp.lang.c
  2. Path: netcom.com!bnelson
  3. From: bnelson@netcom.com (Bob Nelson)
  4. Subject: Re: why not add getch() to the std C RTL?
  5. Message-ID: <bnelsonDM887t.LDI@netcom.com>
  6. Organization: a computer running Linux
  7. X-Newsreader: TIN [version 1.2 PL2]
  8. References: <DM85L8.5Jn@emr1.emr.ca>
  9. Date: Sun, 4 Feb 1996 01:02:17 GMT
  10. Sender: bnelson@netcom16.netcom.com
  11.  
  12. On Sun, 4 Feb 1996 00:05:32 GMT, John Grant wrote:
  13.  
  14. > There are *many* people who want to do the following in their C programs:
  15. > - read a single unbuffered keystroke (getch() in DOS, ioctl in unix...)
  16.  
  17. > The usual response is "not standard C, o/s-specific" etc.
  18.  
  19. I'll just quote the following from "Expert C Programming" by Peter van
  20. der Linden (ISBN 0-13-177429-8) and offer no comments of my own, other
  21. than some emphasis added.  Instead, it'll be interesting to see how
  22. participants in comp.lang.c respond to what PvdL thinks (especially in
  23. the context of your posting). Here's the paragraph from page 213:
  24.  
  25. "People often wonder why ANSI C didn't define a standard function to
  26. get a character if a key has been pressed. Without a standard
  27. function, every system has a different method and program portability
  28. is lost.  The argument against providing kbhit() as part of the
  29. standard is that *it is mostly useful for GAMES software* and there
  30. are many other terminal I/O features that are not standardized. In
  31. addition, you don't want to promise a standard library function *that
  32. SOME OS's will find difficult to provide.* The argument for providing
  33. it is that it is mostly useful for games software and that games
  34. writers don't need the myriad of other terminal I/O features that
  35. could be standardized. Whichever view you hold, it's true the XJ311
  36. missed an opportunity to reinforce C as the language of choice for a
  37. generation of programmers writings games on UNIX."
  38.  
  39. Comments? 
  40.  
  41. -- 
  42. =============================================================================
  43.           Bob Nelson: Dallas, Texas, U.S.A.  -  bnelson@netcom.com
  44.       Linux for fun, M$ for $$$...and the NFL for what really counts!
  45. =============================================================================
  46.  
  47.